<template>
  <div class="leftContainer" >
    <h3>数据发送方 --- count 的值为{{ count }}</h3>
    <button class="btn btn-primary" @click="add" >+1</button>
  </div>
</template>

<script>
import bus from './eventBus.js'
export default {
    data(){
        return {
            count:0
        }
    },
    methods:{
        add(){
            this.count++
            bus.emit('countChange',this.count)
        }
    }
}
</script>

<style scoped lang="less" >
.leftContainer{
    flex: 1;
    border: 1px solid #ccc;
    height: 200px;
    margin-right: 10px;
}
</style>